<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head >
    <title>添加店铺流量记录</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <script src="/layui/layui.js"></script>
    <script>
        var index = 0;
        try{
            index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        }catch (e) {
        }
    </script>
</head>
<body >

<div class="layui-body" style="padding-top:20px;">
    
    <div class="sp-wrapper">
        <div class="order-body">

            <form method="post" class="layui-form" id="sp-form">
                <input type="hidden" name="id" th:value="${model !=null ? model.id : 0}"  readonly autocomplete="off" class="layui-input">
                <div class="layui-form-item">
                    <label class="layui-form-label">店铺：</label>
                    <div class="layui-input-inline">
                        <select name="shopId" id="shopId" lay-verify="required">
                            <option value="" selected>请选择店铺</option>
                            <option  th:each="item: ${shops}" th:text="${item.name + ' - '+ item.typeName}" th:value="${item.id}">等待发货</option>
                        </select>
                    </div>
                        <div class="layui-input-inline">
                            <input type="text" name="date" id="date" lay-verify="required" placeholder="日期" th:value="${model !=null ? model.date : date}"  readonly autocomplete="off" class="layui-input">
                        </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">商品数据</label>
                    <div class="layui-inline">
                        <input type="text" name="visits" th:value="${model !=null ? model.visits : ''}" placeholder="访客数" lay-verify="required|number" style="width:100px;" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="views" lay-verify="required|number" th:value="${model !=null ? model.views : ''}" placeholder="浏览量" style="width:100px;" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="orderUsers" th:value="${model !=null ? model.orderUsers : ''}" placeholder="支付买家数" style="width:100px;" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="orders" th:value="${model !=null ? model.orders : ''}" placeholder="支付订单数" style="width:100px;" autocomplete="off" class="layui-input">
                    </div>
                    </div>
                    <div class="layui-form-item">
                    <label class="layui-form-label"></label>
                    <div class="layui-inline">
                        <input type="text" name="CVR" th:value="${model !=null ? model.CVR : ''}" style="width:100px;"  placeholder="支付转化率"  autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="orderAmount" th:value="${model !=null ? model.orderAmount : ''}" style="width:100px;" placeholder="支付金额" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="collects" th:value="${model !=null ? model.collects : ''}" placeholder="商品收藏用户数" style="width:100px;" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="goods" th:value="${model !=null ? model.goods : ''}" lay-verify="required|number" placeholder="被访问商品数"  style="width:100px;" autocomplete="off" class="layui-input">
                    </div>
                </div>

                
                
               
                <div class="layui-form-item">
                    <label class="layui-form-label">交易数据</label>
                    <div class="layui-inline">
                        <input type="text" name="ATV" style="width:100px;" th:value="${model !=null ? model.ATV : ''}" placeholder="支付客单价"  autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="FSNew" th:value="${model !=null ? model.FSNew : ''}" placeholder="店铺关注" style="width:100px;"  autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="orderLKR" th:value="${model !=null ? model.orderLKR : ''}" placeholder="老客占比" style="width:100px;" autocomplete="off" class="layui-input">
                    </div>

                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">流量数据</label>
                    <div class="layui-inline">
                        <input type="text" name="UVV"  placeholder="成交UV价值" th:value="${model !=null ? model.UVV : ''}" autocomplete="off" style="width:100px;" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="SH" th:value="${model !=null ? model.SH : ''}" placeholder="商品搜索热度"  autocomplete="off" style="width:100px;"  class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="SS" th:value="${model !=null ? model.SS : ''}" placeholder="搜索销售指数" autocomplete="off" style="width:100px;"  class="layui-input">
                    </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">直播数据</label>
                    <div class="layui-inline">
                        <input type="text" name="ZBSC" th:value="${model !=null ? model.ZBSC : ''}" placeholder="直播时长" autocomplete="off" style="width:100px;"  class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="ZBViews" th:value="${model !=null ? model.ZBViews : ''}" placeholder="累计观看" autocomplete="off" style="width:100px;"  class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="ZBRJGK" th:value="${model !=null ? model.ZBRJGK : ''}" placeholder="人均观看时长" autocomplete="off" style="width:100px;"  class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="ZBOrders" th:value="${model !=null ? model.ZBOrders : ''}" placeholder="直播支付订单" autocomplete="off" style="width:100px;"  class="layui-input">
                    </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"></label>
                    <div class="layui-inline">
                        <input type="text" name="ZBOrderAmount" th:value="${model !=null ? model.ZBOrderAmount : ''}" placeholder="直播支付金额" autocomplete="off" style="width:100px;"  class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="ZBCVR" th:value="${model !=null ? model.ZBCVR : ''}" placeholder="直播支付转化率" autocomplete="off" style="width:100px;"  class="layui-input">
                    </div>
                </div>
                
                <div class="layui-form-item">
                    <label class="layui-form-label">粉丝数据</label>
                    <div class="layui-inline">
                        <input type="text" name="FSOrders" th:value="${model !=null ? model.FSOrders : ''}" placeholder="粉丝订单量" style="width:100px;" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="FSROrder" th:value="${model !=null ? model.FSROrder : ''}" placeholder="粉丝订单占比" style="width:100px;" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="FSOrderAmount" th:value="${model !=null ? model.FSOrderAmount : ''}" placeholder="粉丝支付金额" style="width:100px;" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="FSFGL" th:value="${model !=null ? model.FSFGL : ''}" placeholder="粉丝复购率" style="width:100px;" autocomplete="off" class="layui-input">
                    </div>
                    
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">全站推广</label>
                    <div class="layui-inline">
                        <input type="text" name="showsQZ"  placeholder="曝光量" th:value="${model !=null ? model.showsQZ : ''}" autocomplete="off" class="layui-input" style="width:60px;">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="visitsQZ" th:value="${model !=null ? model.visitsQZ : ''}" placeholder="点击量"  autocomplete="off" class="layui-input" style="width:60px;">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="ordersQZ" th:value="${model !=null ? model.ordersQZ : ''}" placeholder="成交量" autocomplete="off" class="layui-input"style="width:60px;">
                    </div>
                    
                    <div class="layui-inline">
                        <input type="text" name="roiQZ" th:value="${model !=null ? model.roiQZ : ''}" placeholder="ROI" autocomplete="off"  class="layui-input" style="width:60px;">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="feeQZ" th:value="${model !=null ? model.feeQZ : ''}" placeholder="花费"  autocomplete="off" style="width:60px;"  lay-verify="required|number" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">搜索推广</label>
                    <div class="layui-inline">
                        <input type="text" name="showsSS"  placeholder="曝光量"  th:value="${model !=null ? model.showsSS : ''}" autocomplete="off" class="layui-input" style="width:60px;">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="visitsSS" th:value="${model !=null ? model.visitsSS : ''}" placeholder="点击量"  autocomplete="off" class="layui-input" style="width:60px;">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="ordersSS" th:value="${model !=null ? model.ordersSS : ''}" placeholder="成交量" autocomplete="off" class="layui-input"style="width:60px;">
                    </div>
                    
                    <div class="layui-inline">
                        <input type="text" name="roiSS" th:value="${model !=null ? model.roiSS : ''}" placeholder="ROI" autocomplete="off" style="width:60px;" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="feeSS" th:value="${model !=null ? model.feeSS : ''}" placeholder="花费"  autocomplete="off" style="width:60px;"   class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="collectsSS" th:value="${model !=null ? model.collectsSS : ''}" placeholder="收藏"  autocomplete="off" style="width:60px;"  class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">场景推广</label>
                    <div class="layui-inline">
                        <input type="text" name="showsCJ"  placeholder="曝光量" th:value="${model !=null ? model.showsCJ : ''}" autocomplete="off" class="layui-input" style="width:60px;">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="visitsCJ" th:value="${model !=null ? model.visitsCJ : ''}" placeholder="点击量"  autocomplete="off" class="layui-input" style="width:60px;">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="ordersSS" th:value="${model !=null ? model.ordersSS : ''}" placeholder="成交量" autocomplete="off" class="layui-input"style="width:60px;">
                    </div>
                    
                    <div class="layui-inline">
                        <input type="text" name="roiCJ" th:value="${model !=null ? model.roiCJ : ''}" placeholder="ROI" autocomplete="off" style="width:60px;" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="feeCJ" th:value="${model !=null ? model.feeCJ : ''}" placeholder="花费"  autocomplete="off" style="width:60px;"   class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <input type="text" name="collectsCJ" th:value="${model !=null ? model.collectsCJ : ''}" placeholder="收藏"  autocomplete="off" style="width:60px;"  class="layui-input">
                    </div>
                </div>
                
                <div class="layui-form-item">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-inline">
                        <input type="text" name="remark" th:value="${model !=null ? model.remark : ''}" placeholder="" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-input-inline">
                        <input type="text" name="dsr" th:value="${model !=null ? model.dsr : ''}" placeholder="店铺DSR" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="add_btn">立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>
        </div>
    <script type="text/javascript" src="/sb/jquery.min.js"></script>
    <script type="text/javascript" src="/sb/Tips.min.js"></script>

    <!-- end sp-wrapper -->
    <script>
        layui.use(['laydate', 'form','layer'], function () {
            var laydate = layui.laydate;
            var form = layui.form;
            var layer = layui.layer;

            //执行一个laydate实例
            laydate.render({
                elem: '#date' //指定元素
            });
            $(function(){
                var shopId = '[[${model !=null ? model.shopId : shopId}]]'
                $("#shopId").val(shopId);
                form.render('select');

                form.on('submit(add_btn)', function(data){
                console.log(data.field);
                $.ajax({
                    type:"POST",
                    url:"/shop/shop_traffic_pdd_add_ajax",
                    processData: false, //表明不要对数据进行处理
                    data:JSON.stringify(data.field),
                    contentType: 'application/json',
                    success:function (res) {
                        if(res.code == 0){
                            parent.layer.msg(res.msg)
                            parent.layer.close(index);
                            parent.location.reload();
                        }else {
                            layer.msg(res.msg)
                        }
                        return false;
                    }
                });
                return false;
            });

            })

            
        });

    </script>
      </div>
    </div>
</div>
</body>
<html>
